Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
eslint-config-xo
Advanced tools
eslint-config-xo is a shareable ESLint configuration package that enforces the XO style guide. XO is a strict and opinionated code style guide for JavaScript and TypeScript, which aims to enforce best practices and consistency in codebases.
Enforcing Code Style
By extending the 'xo' configuration in your ESLint configuration file, you can enforce the XO style guide in your project. This includes rules for code formatting, best practices, and potential errors.
{
"extends": "xo"
}
TypeScript Support
eslint-config-xo provides support for TypeScript by allowing you to extend the 'xo-typescript' configuration. This ensures that TypeScript-specific rules and best practices are enforced.
{
"extends": "xo",
"overrides": [
{
"files": "*.ts",
"extends": "xo-typescript"
}
]
}
React Support
For projects using React, you can extend the 'xo-react' configuration to enforce React-specific linting rules and best practices.
{
"extends": [
"xo",
"xo-react"
]
}
eslint-config-airbnb is a popular ESLint configuration that follows the Airbnb JavaScript style guide. It is widely used and provides a comprehensive set of rules for JavaScript and React. Compared to eslint-config-xo, it is less strict and more flexible, making it suitable for a broader range of projects.
eslint-config-standard is another popular ESLint configuration that follows the JavaScript Standard Style. It is less opinionated than eslint-config-xo and focuses on simplicity and ease of use. It is a good choice for projects that prefer a more relaxed coding style.
eslint-config-prettier is an ESLint configuration that disables all rules that are unnecessary or might conflict with Prettier. It is often used in combination with other configurations like eslint-config-airbnb or eslint-config-standard to ensure code formatting is handled by Prettier while still enforcing other linting rules.
ESLint shareable config for XO
This is for advanced users. You probably want to use XO directly.
See eslint-plugin-xo for some additional useful rules.
$ npm install --save-dev eslint-config-xo
For the esnext
version you'll also need Babel's ESLint parser and plugin:
$ npm install --save-dev babel-eslint eslint-plugin-babel
This will let you use ES2016 features like async
/await
and decorators. For a full list of features see Babel's experimental features and their Learn ES2015.
Add some ESLint config to your package.json
:
{
"name": "my-awesome-project",
"eslintConfig": {
"extends": "xo"
}
}
Or to .eslintrc
:
{
"extends": "xo"
}
Supports parsing ES2015, but doesn't enforce it by default.
This package also exposes xo/esnext
if you want ES2015+ rules:
{
"extends": "xo/esnext"
}
And xo/browser
if you're in the browser:
{
"extends": "xo/browser"
}
MIT © Sindre Sorhus
FAQs
ESLint shareable config for XO
The npm package eslint-config-xo receives a total of 133,862 weekly downloads. As such, eslint-config-xo popularity was classified as popular.
We found that eslint-config-xo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.